package com.example.recycleview;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

public class MainActivity3 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);
        Intent intent = getIntent();
        Log.d("life","acitivity3 is oncreate");
       // Intent intent1=new Intent();
        String name1=intent.getStringExtra("name");
        if(name1.equals("chf")){
            intent.putExtra("sta","我今天想跑步~");
        }
        else {
            if(name1.equals("lda")) {
                intent.putExtra("sta", "java kkk");
            }
        }
        /*intent1.putExtra("name1","我今天想跑步~");
        setResult(31,intent1);
        Intent intent2=new Intent();
        intent2.putExtra("name2","java kkk");*/
        setResult(31,intent);
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.d("life", "acitivity3 is onResume");
        //Toast.makeText(this,"acitivity3 is onResume",Toast.LENGTH_LONG).show();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.d("life", "acitivity3 is onDestroy");
        //Toast.makeText(this,"acitivity3 is onDestroy",Toast.LENGTH_LONG).show();
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.d("life", "acitivity3 is onStart");
        //Toast.makeText(this,"acitivity3 is onStart",Toast.LENGTH_LONG).show();
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.d("life", "acitivity3 is onRestart");
        //Toast.makeText(this,"acitivity3 is restart",Toast.LENGTH_LONG).show();
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.d("life", "acitivity3 is onPause");
    }

    @Override
    public void finish() {
        super.finish();
        Log.d("life","acitivity3 is finish");

    }

    @Override
    public void finishActivity(int requestCode) {
        super.finishActivity(requestCode);
        Log.d("life","acitivity3 is finishActivity");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.d("life", "acitivity3 is onStop");
        //Toast.makeText(this,"acitivity3 is onstop",Toast.LENGTH_LONG).show();

    }
}